feat: extract project/environment helpers for multi-project support#657
Merged
DevonFulcher merged 6 commits intomainfrom Mar 18, 2026
Merged
feat: extract project/environment helpers for multi-project support#657DevonFulcher merged 6 commits intomainfrom
DevonFulcher merged 6 commits intomainfrom
Conversation
This was referenced Mar 17, 2026
69ce9db to
9afd83f
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
beeaff9 to
4cf34e6
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This will be introduced in the first phase where it has non-empty content. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3a4bf94 to
70b2a82
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This is Phase 1 of the multi-project feature, extracting shared helper functions that both Server A (env-var mode) and Server B (multi-project mode) will use. This extraction is the blocking dependency for all subsequent phases.
What
New
src/dbt_mcp/project/module with extracted helpers:environment_resolver.py—resolve_environments()(pure logic) andget_environments_for_project()(API + resolution)project_resolver.py—get_all_accounts()andget_all_projects_for_account()Refactored config providers (
config_providers.py):get_config()(existing, unchanged behavior) and a_build_config()static methodget_config_for_project(project_id)from all four providers — env resolution belongs in tool functions, not providers, keeping providers statelessget_environments_for_project()directly at call-time and pass the resolved environment ID to the provider's_build_config()or construct the config override inlineRefactored
fastapi_app.py:resolve_environments()Added
DBT_MCP_MULTI_PROJECT_ENABLEDenv var check inmain.py:true/1/yes, raisesNotImplementedError(stub for Server B, implemented in Phase 7)Updated existing pagination tests to reference new module paths
Notes
task checkpasses (lint, format, mypy)Drafted by Claude Sonnet 4.6 under the direction of @DevonFulcher